import com.atshiyou.bean.Grade;
import com.atshiyou.bean.Student;
import com.atshiyou.dao.GradeDao;
import com.atshiyou.util.SqlSessionUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

public class TestGrade {
    public static void main(String[] args) {
        SqlSession session = SqlSessionUtil.getSession();
        GradeDao gradeDao = session.getMapper(GradeDao.class);
        List<Student> allStudent = gradeDao.findAllStudent();

        for(Student s:allStudent){
            System.out.println(s+","+s.getGrade().getgName());
        }
        SqlSessionUtil.closeSession();
    }
}
